<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <button>防抖</button>
  <button class="btn">post</button>


  <script src="./jquery-3.6.0/jQuery3.6.js"></script>
  <script type="text/javascript">
    var tirme = null
    $('button').on('click', function(){
      clearTimeout(tirme);
      tirme = setTimeout(() => {
        console.log(1);
      }, 2000);
    })



    $(function(){
      $('.btn').on('click', function(){
        $.ajax({
          method: 'post',
          url: 'http://www.liulongbin.top:3006/api/post',
          data: {name: 'zs', age: 29}
        })
      })
    })
  </script>
</body>
</html>